const values_default = {}

const domain_default = {}

const fields_default = {
  word: null,
  number: null,
  name: null,
  is_key: null,
  part_of_speech_ids: null,
  part_of_speech: null,
  meanings_cn: null
  // meaning_ids: null,
  //  example_ids: null
}

const filterItems = [
  { type: 'input', name: 'name___like', placeholder: '单词' }
]

const columns = [
  { name: 'name', type: 'char', label: 'Word' },
  { name: 'number', type: 'char', label: 'No' },
  { name: 'is_key', type: 'boolean', label: 'Key' },
  { name: 'part_of_speech', type: 'char', label: 'Part of Speech' },
  { name: 'meanings_cn', type: 'char', label: 'Meaning' }
]

const formItems = [
  { type: 'input', name: 'word', label: 'Word' },
  { type: 'input', name: 'number', label: 'No' },
  {
    type: 'checkbox',
    name: 'is_key',
    label: 'Key',
    text: 'Is Key',
    default: true
  },
  {
    type: 'select',
    name: 'part_of_speech_ids',
    multiple: true,
    rules: { required: false },
    label: 'Part of speech',
    placeholder: 'Part of speech',
    default: []
  }
]

const Model = {
  configs: {
    values_default,
    domain_default,
    fields_default,
    filterItems,
    columns,
    formItems
  },

  extend: BaseClass => {
    class ModelClass extends BaseClass {
      global_domain(domain = {}) {
        return super.global_domain(domain)
      }
    }
    return ModelClass
  }
}

export default Model
